<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<input name="baseUrl" id="baseUrl" value="<?php echo $baseurl?>" type="hidden" />
<link rel="stylesheet" href="<?php echo $baseurl?>public/assets/export/css/style.default.css" type="text/css" />
<script type="text/javascript" src="<?php echo $baseurl?>public/assets/export/js/plugins/jquery-1.7.min.js"></script>
<script src="<?php echo $baseurl?>public/assets/js/custom.js"></script>
<link rel="stylesheet" href="<?php echo $baseurl?>public/assets/css/font-awesome.min.css" type="text/css" />
<style>
    .closepopup{
        position: fixed;
        top: 0;
        right: 0;
        width: 40px;
        height: 38px;
        background-color: rgba(225,102,0,.6);
        border-bottom-left-radius: 50% !important;
        border-bottom-right-radius: 5% !important;
        border-top-left-radius: 5% !important;
        border-top-right-radius: 0 !important;
        border-radius: 50%;
        border: 0;
        line-height: 1;
        font-size: 18px;
        cursor: pointer;
        z-index: 99999;
    }
</style>
<button class="closepopup" onclick="closeIframe()"><i class="fa fa-close"></i></button>
<div class="pageheader">
            <ul class="hornav">
                <li class="current" style="width:  200px;"><a href="#updates">Log truy cập</a></li>
            </ul>
</div><!--pageheader-->
<form>
<div id="contentwrapper" class="contentwrapper">
	<div id="updates" class="subcontent">
            <div class="two_third content_left" style="width: 98%">
            <div class="tableoptions" style="padding: 15px;">
                <span onclick="exportToExcel()" id="addCategories" class="submit radius2">Xuất file excel</span>
                <span onclick="exportToDoc()" id="addCategories" class="submit radius2">Xuất file word</span>
                <span onclick="closeIframe()" id="addCategories" class="submit radius2">Hủy bỏ</span>
            </div>
            <input type="hidden" name="idCheck" id="idCheck" value="" />
            <input type="hidden" name="delete" id="delete" value="" />
            <input type="hidden" name="control" id="control" value="" />
            <input type="hidden" name="urlProduct" id="urlProduct" value="" />
            <div id="boxTool">
            
            
            
            </div>
            <div class="span8" id="page">
                <div class="block" style="border-radius: 5px">                        
                   <div class="block-fluid" id="page_show">
                        <table cellpadding="0" cellspacing="0" width="100%" id="Categrories" class="table stdtable stdtablecb">
                            <thead>
                                <tr style="border-top: 1px solid #ccc">                                    
                                    <th colspan="6" style="background: #ececec;padding: 10px;border-bottom: none;font-size: 20px;font-weight: normal;"><center>Log truy cập chiến dịch <?php echo $nameplace->title?></center></th>                                    
                                </tr>
                                <tr style="border-top: 1px solid #ccc">                                    
                                    <th colspan="6" style="background: #ececec;padding: 10px;border-bottom: none;font-size: 20px;font-weight: normal;"><center>Địa điểm <?php echo $nameplace->shopName?></center></th>                                    
                                </tr>
                                <tr>                                    
                                    <th width="auto">STT</th>
                                    <th width="25%">Trình duyệt</th>
                                    <th width="20%">Hệ điều hành</th>
                                    <th width="20%">Loại Thiết bị</th>
                                    <th width="20%">Tên thiết bị</th>
                                    <th width="25%">Thời gian</th>                                     
                                </tr>
                            </thead>
                            <tbody>
                            <?php if(!in_array($data, array(null, '', '0'))):?>
                            <?php $cf = 1; foreach($data AS $el=>$le):?>
                                <tr>                                    
                                    <td><center><?php echo $cf++;?></center></td>
                                    <td><?php echo $le['browser_name'] == '' ? 'Chưa xác định' : $le['browser_name'] ?></td>
                                    <td><?php echo $le['os_name'] == '' ? 'Chưa xác định' : $le['os_name']?> </td>
                                    <td><?php echo $le['device_name'] == 'Other' ? 'Máy tính' : 'Di động' ?> </td>  
                                    <td><?php echo $le['device_name'] == 'Other' ? 'Máy tính' : $le['device_name'] ?> </td>
                                    <td><?php echo $le['show_full_time']?> </td>                                
                                </tr>
                            <?php endforeach;?>    
                            <?php endif;?>                
                            </tbody>
                        </table>
                    </div> 
                </div>
            </div>
        </div>
    </div>
     <div class="orverlay">
            <div class="box_orverlay">
                Đang xuất file...
            </div>
        </div>
        <style>
        .orverlay{
            left: 0px;float: left;width: 100%;background: url('public/theme/analytics/images/black_opacity.png') repeat; height: 100%;position: fixed;top: 0;z-index: 99999999;overflow: auto;box-sizing: border-box;display: none;padding-top:15%
        }
        .orverlay .box_orverlay{
            margin: 60px auto;width: 110px;background: #FFF;font-size: 15px;color: #666;padding: 10px;
        }
        .orverlay .box_orverlay h2{
            float: left;width: 100%;margin-top: -3px;background: orange;color: #fff;font-weight: normal;
        }
        .orverlay .box_orverlay p{
            padding: 5px 10px
        }
        </style>
    <script>
    window.parent.$(".orverlay").css('display','none');
    function exportToExcel()
    {
        var data='<table border="1">'+jQuery("#Categrories").html().replace(/<a\/?[^>]+>/gi, '')+'</table>';
        jQuery('body').prepend("<form method='post' action="+'<?php echo site_url()?>/exportexcel.php'+" style='display:none' id='Categroriess'><textarea type='text' name='tableData' >"+data+"</textarea></form>");        
        $(".orverlay").css('display', 'block');
        jQuery('#Categroriess').submit(function(e)
        {
            setTimeout(function()
            {
                $(".orverlay").css('display', 'none');
            }, 6000);
        });
        jQuery('#Categroriess').submit().remove();
        //setTimeout(function(){closeIframe();}, 5000);
        return false;
    }
    function exportToDoc()
    {
        var data='<table border="1" align="center">'+jQuery("#Categrories").html().replace(/<a\/?[^>]+>/gi, '')+'</table>';
        jQuery('body').prepend("<form method='post' action="+'<?php echo site_url()?>/exportdoc.php'+" style='display:none' id='Categroriess'><textarea type='text' name='tableData' >"+data+"</textarea></form>");        
        $(".orverlay").css('display', 'block');
        jQuery('#Categroriess').submit(function(e)
        {
            setTimeout(function()
            {
                $(".orverlay").css('display', 'none');
            }, 6000);
        });
        jQuery('#Categroriess').submit().remove();
        //setTimeout(function(){closeIframe();}, 5000);
        return false;
    }
    </script>